//#region Using Statements
//using System;
//using System.Collections.Generic;
//using Microsoft.Xna.Framework;
//using Microsoft.Xna.Framework.Content;
//using Microsoft.Xna.Framework.Graphics;
//using System.Diagnostics;
//#endregion

//namespace Xfinity.Engine.Plugins
//{
//    /// <summary>
//    /// This is a game component that implements IUpdateable.
//    /// </summary>
//    public class TerrainManager : Microsoft.Xna.Framework.DrawableGameComponent
//    {
//        /// <summary>
//        /// Construct a new terrain object
//        /// </summary>
//        /// <param name="game">The running game object.</param>
//        /// <param name="terrainPath">The path to the compiled model to be used as terrain.</param>
//        public TerrainManager(Game game, string terrainPath, TerrainType terrainType)
//            : base(game)
//        {
//            this.terrainPath = terrainPath;
//            this.terrainType = terrainType;
//            content = new ContentManager(game.Services);
//        }
//        public TerrainManager(Game game, string terrainPath) : this(game, terrainPath, TerrainType.Heightmap) { }

//        /// <summary>
//        /// Allows the game component to perform any initialization it needs to before starting
//        /// to run.  This is where it can query for any required services and load content.
//        /// </summary>
//        public override void Initialize()
//        {

//            base.Initialize();
//        }

//        /// <summary>
//        /// Allows the game component to update itself.
//        /// </summary>
//        /// <param name="gameTime">Provides a snapshot of timing values.</param>
//        public override void Update(GameTime gameTime)
//        {

//        }
//        public override void Draw(GameTime gameTime)
//        {

//            //for (int x = 0; x < this.patches.Length - 1; x++)
//            //{
//            //    for (int y = 0; y < patches[x].Length - 1; y++)
//            //    {
//            //        Debug.WriteLine(Xfinity.Resources.DrawingBezierTerrainPatchX + x.ToString() + ", Y=" + y.ToString());
//            //        patches[x][y].Draw();
//            //    }
//            //}
//        }

//        ContentManager content;
//        //BezierPatch[][] patches;
//        string terrainPath;
//        TerrainType terrainType;
//        Texture2D heightMap;
//        /// <summary>
//        /// Load a new terrain.
//        /// </summary>
//        /// <param name="terrainPath">The path of the terrain model to load.</param>
//        public void LoadTerrain(string terrainPath)
//        {
//            switch (terrainType)
//            {
//                case TerrainType.Heightmap:
//                    heightMap = content.Load<Texture2D>(terrainPath);
//                    this.terrainPath = terrainPath;
//                    //patches = BezierPatch.ConstructFromHeightmap(heightMap);

//                    break;
//                case TerrainType.Model:
//                    throw new NotImplementedException("Use TerrainType.Heightmap for now.");
//            }

//        }


//        protected override void LoadGraphicsContent(bool loadAllContent)
//        {
//            if (loadAllContent)
//            {
//                LoadTerrain(terrainPath);

//            }
//        }



//        protected override void Dispose(bool disposing)
//        {
//            try
//            {
//                if (content != null)
//                {
//                    content.Unload();
//                    content.Dispose();
//                }
//            }
//            finally
//            {
//                base.Dispose(disposing);
//            }
//        }
//    }


//    public enum TerrainType
//    {
//        /// <summary>
//        /// Use a model for the terrain.
//        /// </summary>
//        Model,
//        /// <summary>
//        /// Use a smoothed heightmap for the terrain.
//        /// </summary>
//        Heightmap,
//    }
//}